//@ sourceURL=RelatedPartyProtocolForm.js
RelatedPartyProtocolForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        RelatedPartyProtocolForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "相关方协议添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/relatedparty/saveRelatedPartyProtocol.do",
                items:[
                       {
                           id : "relatedPartyProtocol.id",
                           name : "relatedPartyProtocol.id",
                           xtype : "hidden",
                           value : this.id == null ? "": this.id
                       }, {
                           name : "relatedPartyProtocol.years",
                           xtype : "hidden",
                           id : "relatedPartyProtocol.years",
                           value : this.years == null ? "" : this.years
                       },{
                           layout:"column",
                           bodyStyle:"padding:5px;",
                           items:[{
                               layout:"form",
                               bodyStyle:"padding:5px;",
                               defaultType:"textfield",
                               border:false,
                               columnWidth:0.5,
                               items:[{
                                   fieldLabel: '所属机构', 
                                   name: 'relatedPartyProtocol.institution'
                               }]
                       },{
                          layout:"form",
                          columnWidth:.5,
                          border:false,
                          bodyStyle:"padding:5px;",
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:'协议编号'+'<font color=red>*</font>',
                              id:"relatedPartyProtocol.protocolNo",
                              name:"relatedPartyProtocol.protocolNo",
                             // maxLength:80,
                              allowBlank:false,
                              blankText:"协议编号不能为空！"
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          border:false,
                          bodyStyle:"padding:5px;",
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:'协议名称'+'<font color=red>*</font>',
                              id:"relatedPartyProtocol.protocolName",
                              name:"relatedPartyProtocol.protocolName",
                             // maxLength:80,
                              allowBlank:false,
                              blankText:"协议名称不能为空！"
                          }]
                      },{
                          layout:"form",
                          border:false,
                          bodyStyle:"padding:5px;",
                          columnWidth:.5,
                          items:[{
                              //下拉选型设置
                                  fieldLabel : "相关方类型",
                                  hiddenName : "relatedPartyProtocol.relatedType",
                                  xtype : "combo",
                                  mode : "local",
                                  width : 146 ,
                                  editable : false,
                                  triggerAction : "all",
                                  store : [
                                          [ "1", "供方" ],
                                          [ "2", "协作方" ],
                                          [ "3", "承包方" ],
                                          [ "4", "其它" ]],
                                  value : 1
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"相关方名称",
                              id:"relatedPartyProtocol.relatedName",
                              name:"relatedPartyProtocol.relatedName",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
//                        True表示为显示出面板body元素的边框，false则隐藏
                          defaultType:"textfield",
                          items:[{
                              fieldLabel:"协议有效期",
                              id:"relatedPartyProtocol.protocolValidity",
                              name:"relatedPartyProtocol.protocolValidity",
                             // maxLength:80,
                              allowBlank:true
                              
                          }]
                      },{
                          layout:"form",
                          columnWidth:.5,
                          bodyStyle:"padding:5px;",
                          border:false,
                          items:[{
                              xtype:"datefield",
                              fieldLabel:'签订时间'+'<font color=red>*</font>',
                              id:"relatedPartyProtocol.signDate",
                              format:"y-m-d",
                              name:"relatedPartyProtocol.signDate",
                              allowBlank:false,
                              width : 146, 
                              blankText:"签订时间不能为空！"
                          }]
                      }
                      ]
               },{
                   layout:"column",
                   bodyStyle:"padding:5px;",
                   items:[{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       items:[{
                       xtype:"textarea", 
                       fieldLabel: '协议内容', 
                       name: 'relatedPartyProtocol.protocolContent', 
                      // maxLength:300,
                       width : 448 
                       }]
                   },{
                       columnWidth:1.,//第一列 
                        layout:"form", 
                        bodyStyle:"padding:5px;",
                        items:[{ 
                            xtype:"textarea", 
                            fieldLabel: '备注', 
                            name: 'relatedPartyProtocol.remark', 
                            width:448 
                            }] 
                   }]
           }
           ]
        },
        loadData:{
            getUrl:__ctxPath +"/relatedparty/getRelatedPartyProtocol.do",
            preName : "relatedPartyProtocol"
        },
        isShow:this.isShow
        
    });
}
});
